<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2024/1/12
  Time: 10:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>request作用域</title>
</head>
<body>
    <%
        List<String> books = new ArrayList<String>();
        books.add("《三国演义》");
        books.add("《西游记》");
        books.add("《水浒传》");
        books.add("《西游记》");
        request.setAttribute("books",books);
        // 转发：
        request.getRequestDispatcher("/scope/list.jsp").forward(request,response);
        // 重定向：
        // response.sendRedirect("/scope/list.jsp");
    %>
    <%--    request作用域：只在同一次请求中通过转发可以取得值，否则，得不到值！--%>
</body>
</html>
